<?php
	session_start();
?>

<STYLE type=text/css>.blank {
	FONT-SIZE: 0px; WIDTH: 0px; HEIGHT: 0px
}
TD {
	FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
INPUT {
	FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
.present {
	FONT-WEIGHT: bold; BACKGROUND-COLOR: #dee5ec
}
.h1 {
	FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #ffffff
}
.d1 {
	COLOR: #c0c0c0
}
.link {
	FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: #ffffff; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
.footer {
	FONT-WEIGHT: normal; FONT-SIZE: 10px; COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
.footer1 {
	FONT-WEIGHT: bold; FONT-SIZE: 10px; BACKGROUND-IMAGE: url(chat/images/menu_b.gif); CURSOR: default; COLOR: #000000; BORDER-BOTTOM: 0px
}
.header {
	FONT-WEIGHT: bold; FONT-SIZE: 10px; BACKGROUND-IMAGE: url(chat/images/menu_h.gif); CURSOR: default; COLOR: #000000; BORDER-BOTTOM: 0px
}
.textcol {
	FONT-SIZE: 12px; COLOR: #2378d5; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
</STYLE>

<?php
    $sel_sesi=$_GET["sesi"];
	$sel_periode=$_GET["periode"];
	$nrpx=$_GET["nrp"];
	include("header_admin.html");
	include("connect.php");
	$pilih=mysql_select_db("uwika_krs",$conn);
	$sqlstr="select nama from biodata where nrp='$nrpx'";
	$hasil=mysql_query($sqlstr);
	$row = mysql_fetch_row($hasil);
	list($nama) = $row;
	echo "<BR>";
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Berikut dibawah ini adalah daftar mata kuliah yang sudah anda daftarkan pada KRS :";
	echo "<br>";
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N R P &nbsp&nbsp&nbsp&nbsp : " . $nrpx;
	echo "<br>";
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nama &nbsp&nbsp&nbsp&nbsp : " . $nama;
	echo "<br>";
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Semester : " . $sel_sesi;
	echo "<br>";
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Periode &nbsp&nbsp : " . $sel_periode;
	
	echo "<br><BR>";
	echo "<table width=\"100%\" border=\"0\">";
	echo "<table align=center width=\"700\" border=\"1\">";
	echo "<tr>";
	echo "<td width=\"50\"><center>K O D E</center></td>";
	echo "<td width=\"200\"><center>N A M A &nbsp; M A T A  &nbsp; K U L I A H</center></td>";
	echo "<td width=\"10\"><center>STATUS</center></td>";
	echo "<td width=\"25\"><center>SKS</center></td>";
	echo "</tr>";

	$sqlstr="select registrasi.kodemk, matakuliah.nama, matakuliah.sks, registrasi.sesi, registrasi.status, registrasi.validasi from registrasi,matakuliah where sesi='$sel_sesi' and periode='$sel_periode' and nrp='$nrpx' and registrasi.kodemk=matakuliah.kodemk";
	$hasil=mysql_query($sqlstr);
	$row = mysql_fetch_row($hasil);
	$jmlsks=0;
	do {
		list($kodemk,$nama,$sks,$sesi,$status,$validasi) = $row;
		if (empty($kodemk)) {
		break;
		} 
		if ($validasi==0) {
			echo "<tr><td width=\"50\"><center><a href=\"hapus.php?nrp=$reg_uname&kodemk=$kodemk&sesi=$sesi&periode=$sel_periode\"> $kodemk </center></td>";
		} else {
			echo "<tr><td width=\"50\"><center>$kodemk</center></td>";
		}
		echo "<td width=\"200\"> $nama </td>";
		echo "<td width=\"10\"><center> $status </center></td>";
		echo "<td width=\"25\"><center> $sks </center></td>";
		echo "</tr>";
		$jmlsks=$jmlsks + $sks; 
	} while ($row=mysql_fetch_row($hasil));
	echo "</table>";
	echo "<table width=\"750\" border=\"0\">";
	echo "<tr><td width=\"595\"></td><td>TOTAL SKS :</td><td width=65><center>" . $jmlsks . "</center></td></tr>";
	echo "</table></table>";
	echo "<br>";

	echo "<table width=\"100%\" border=\"0\">";
	echo "<tr><td width=\"40%\"></td>";
	if ($validasi==0) {
		echo "<form name=\"frmdaftar\" method=\"post\" action=\"validasi.php\">";
		echo "<input type=hidden name=nrpx value=" . $nrpx . ">";
		echo "<input type=hidden name=periodex value=" . $sel_periode . ">";
		echo "<input type=hidden name=sesix value=" . $sel_sesi . ">";
		echo "<td width=\"5%\"> " . "<input name=\"Submit\" type=\"submit\" value=\"Set Valid!\">" . "</td>";
		echo "</form>";
		echo "<form name=\"frmbatal\" method=\"post\" action=\"\">";
		echo "<td>" . "<input type=\"button\" value=\"Kembali\" onClick=\"javascript: history.go(-1)\">" . "</td></tr>";
	} else {
		echo "<form name=\"frmbatal\" method=\"post\" action=\"\">";
		echo "<td>" . "<input type=\"button\" value=\"Kembali\" onClick=\"javascript: history.go(-1)\">" . "</td></tr>";
	}
	echo "</form>";
	echo "</table>";
	echo "<br>";
	echo "<br><br>";

	include("footer.php");
?>